package dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import tools.DBTools;

public class LicenseDetailDao {
	public void addLicense(String lic_id,int id,String card_img)
	{
	 Connection conn = DBTools.getInstance().getConnection();
	String sql="insert into tbl_license_detail(license_id,id,card_img) values(?,?,?)";
	PreparedStatement ps=null;
	try {
		ps=conn.prepareStatement(sql);
		ps.setString(1, lic_id);
		ps.setInt(2, id);
		ps.setString(3, card_img);
		boolean bl=ps.execute();
		if(!bl)
		{
			System.out.println("数据添加成功");
		}else {
			System.out.println("数据添加失败");
		}
	} catch (SQLException e) {
		e.printStackTrace();
		}finally {
			DBTools.getInstance().closeConnection(conn, ps, null);
	}
}
}
